<template>
  <div>
    <el-form>
      <el-form-item label="角色名称" label-width="100px">
        <el-input v-model="rolename"></el-input>
      </el-form-item>
      <el-form-item label="角色编码" label-width="100px">
        <el-input v-model="rolecode"></el-input>
      </el-form-item>
      <el-form-item label="创建时间:" label-width="100px">
        <el-date-picker v-model="timeArr" value-format="yyyy-MM-dd" clearable>
        </el-date-picker>
      </el-form-item>
      <el-form-item label="备注" label-width="100px">
        <el-input v-model="notes"></el-input>
      </el-form-item>
    </el-form>
    <el-button type="primary" @click="getRole">确认</el-button>
  </div>
</template>

<script>

export default {
  name: 'AddRole',
  data() {
    return {
      rolename: '',
      rolecode: "",
      timeArr: "",
      notes: ""
    }
  },
  mounted() {

  },
  methods: {
    getRole() {
      this.getRoleList()
    },
    async getRoleList() {
      let res = await this.$API.SystemMenus.addSystemRole(this.rolename, this.rolecode, this.timeArr, this.notes)
      if (res.code == 200) {
        this.$message({ message: '新增成功', type: 'success' })
        this.$emit("getRoleList")
        this.$emit("close")

      }
    },
  }
};
</script>

<style scoped></style>
